package com.tange.module.core.wifi.scan

import com.tg.appcommon.android.TGLog

/**
 * 负责将设备ID，拼接为完整的AP名称
 */
object DeviceAccessPointNameStitching {

    const val TAG = "DeviceAccessPointNameStitching_"

    var transform: Transform = Default()

    fun parse(deviceId: String) = transform.parse(deviceId).also {
        TGLog.i(TAG, "[parse] deviceId = $deviceId, ret = $it")
    }

    interface Transform {
        fun parse(deviceId: String): String
    }

    class Default: Transform {
        override fun parse(deviceId: String): String  {
            if (deviceId.startsWith("AICAM")) return deviceId
            else return "AICAM_$deviceId"
        }
    }
}